import request from '/@/utils/request';

export function getWidgetList(query: Object) {
    return request({
        url: '/api/v1/system/widget/all',
        method: 'get',
        params: query
    })
}

export function getWidgetPage(query: Object) {
    return request({
        url: '/api/v1/system/widgets',
        method: 'get',
        params: query
    })
}

export function getWidget(query: Object) {
    return request({
        url: '/api/v1/system/widget/detail',
        method: 'get',
        params: query
    })
}

export function addWidget(params?: Object) {
    return request({
        url: '/api/v1/system/widget/add',
        method: 'post',
        data: params
    })
}

export function updateWidget(params?: Object) {
    return request({
        url: '/api/v1/system/widget/update',
        method: 'put',
        data: params
    })
}

export function deleteWidget(params?: Object) {
    return request({
        url: '/api/v1/system/widget/delete',
        method: 'delete',
        data: params
    })
}
